package com.example.aop.aspect;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class BeforeAdviceAspect {
    // 对add, delete, find方法进行前置增强
    @Before("execution(* com.example.aop.OrderService.add(..)) || " +
           "execution(* com.example.aop.OrderService.delete(..)) || " +
           "execution(* com.example.aop.OrderService.find(..))")
    public void beforeAdvice() {
        System.out.println("hello, 我是一个前置增强");
    }
}
